//
//  ViewController5.m
//  someDemo
//
//  Created by Reinhard-X on 2016/12/5.
//  Copyright © 2016年 上官惠阳. All rights reserved.
//

#import "ViewController5.h"
#import "CheckVersion.h"

@interface ViewController5 ()<UITextFieldDelegate>

@end

@implementation ViewController5

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupForDismissKeyboard];
    self.infromBtn.layer.cornerRadius = 5;
    self.infromBtn.layer.masksToBounds = YES;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (void)selertx
{
    UIAlertController *alerControl = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
    UIAlertAction *alert1 = [UIAlertAction actionWithTitle:@"男" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
    }];
    UIAlertAction *alert2 = [UIAlertAction actionWithTitle:@"女" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
    }];
    UIAlertAction *cancleAlert = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
    }];
    [alerControl addAction:alert1];
    [alerControl addAction:alert2];
    [alerControl addAction:cancleAlert];
    [self presentViewController:alerControl animated:YES completion:nil];
}
- (void)goutoimage:(UIImagePickerControllerSourceType)sourceType
{
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.delegate = self;
    imagePickerController.allowsEditing = YES;
    imagePickerController.sourceType = sourceType;
    imagePickerController.navigationBar.barTintColor = [UIColor blueColor];
    [imagePickerController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName, nil]];
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    [self presentViewController:imagePickerController animated:YES completion:^{}];
}

- (IBAction)exitBtnAction:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}


- (IBAction)selertActon:(id)sender {
    [self selertx];
}

- (IBAction)gotoimegAction:(id)sender {
    [self goutoimage:UIImagePickerControllerSourceTypePhotoLibrary];
}
- (IBAction)checkAction:(id)sender {
    [CheckVersion check_APP_UPDATE_WITH_APPID:@"662004496"];
}
@end
